\(\int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx\) [430]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 121 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {3}{8} b \left (4 a^2+b^2\right ) x+\frac {a \left (a^2+4 b^2\right ) \sin (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (a+b \cos (c+d x))^2 \sin (c+d x)}{4 d}+\frac {(a+b \cos (c+d x))^3 \sin (c+d x)}{4 d} \]

[Out]

3/8*b*(4*a^2+b^2)*x+1/2*a*(a^2+4*b^2)*sin(d*x+c)/d+1/8*b*(2*a^2+3*b^2)*cos(d*x+c)*sin(d*x+c)/d+1/4*a*(a+b*cos(
d*x+c))^2*sin(d*x+c)/d+1/4*(a+b*cos(d*x+c))^3*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2832, 2813} \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {a \left (a^2+4 b^2\right ) \sin (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {3}{8} b x \left (4 a^2+b^2\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}+\frac {a \sin (c+d x) (a+b \cos (c+d x))^2}{4 d} \]

[In]

Int[Cos[c + d*x]*(a + b*Cos[c + d*x])^3,x]

[Out]

(3*b*(4*a^2 + b^2)*x)/8 + (a*(a^2 + 4*b^2)*Sin[c + d*x])/(2*d) + (b*(2*a^2 + 3*b^2)*Cos[c + d*x]*Sin[c + d*x])
/(8*d) + (a*(a + b*Cos[c + d*x])^2*Sin[c + d*x])/(4*d) + ((a + b*Cos[c + d*x])^3*Sin[c + d*x])/(4*d)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2832

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Sim
p[b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rubi steps \begin{align*} \text {integral}& = \frac {(a+b \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{4} \int (3 b+3 a \cos (c+d x)) (a+b \cos (c+d x))^2 \, dx \\ & = \frac {a (a+b \cos (c+d x))^2 \sin (c+d x)}{4 d}+\frac {(a+b \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{12} \int (a+b \cos (c+d x)) \left (15 a b+3 \left (2 a^2+3 b^2\right ) \cos (c+d x)\right ) \, dx \\ & = \frac {3}{8} b \left (4 a^2+b^2\right ) x+\frac {a \left (a^2+4 b^2\right ) \sin (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (a+b \cos (c+d x))^2 \sin (c+d x)}{4 d}+\frac {(a+b \cos (c+d x))^3 \sin (c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.34 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.83 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {8 a \left (4 a^2+9 b^2\right ) \sin (c+d x)+b \left (48 a^2 c+12 b^2 c+48 a^2 d x+12 b^2 d x+8 \left (3 a^2+b^2\right ) \sin (2 (c+d x))+8 a b \sin (3 (c+d x))+b^2 \sin (4 (c+d x))\right )}{32 d} \]

[In]

Integrate[Cos[c + d*x]*(a + b*Cos[c + d*x])^3,x]

[Out]

(8*a*(4*a^2 + 9*b^2)*Sin[c + d*x] + b*(48*a^2*c + 12*b^2*c + 48*a^2*d*x + 12*b^2*d*x + 8*(3*a^2 + b^2)*Sin[2*(
c + d*x)] + 8*a*b*Sin[3*(c + d*x)] + b^2*Sin[4*(c + d*x)]))/(32*d)

Maple [A] (verified)

Time = 2.63 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\frac {a^{3} \sin \left (d x +c \right )+3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(102\)
default \(\frac {a^{3} \sin \left (d x +c \right )+3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(102\)
parallelrisch \(\frac {48 a^{2} b d x +12 b^{3} d x +32 a^{3} \sin \left (d x +c \right )+72 \sin \left (d x +c \right ) a \,b^{2}+\sin \left (4 d x +4 c \right ) b^{3}+8 \sin \left (3 d x +3 c \right ) a \,b^{2}+24 \sin \left (2 d x +2 c \right ) a^{2} b +8 \sin \left (2 d x +2 c \right ) b^{3}}{32 d}\) \(102\)
parts \(\frac {a^{3} \sin \left (d x +c \right )}{d}+\frac {b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {a \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{d}+\frac {3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(110\)
risch \(\frac {3 a^{2} b x}{2}+\frac {3 b^{3} x}{8}+\frac {a^{3} \sin \left (d x +c \right )}{d}+\frac {9 a \,b^{2} \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (4 d x +4 c \right ) b^{3}}{32 d}+\frac {\sin \left (3 d x +3 c \right ) a \,b^{2}}{4 d}+\frac {3 \sin \left (2 d x +2 c \right ) a^{2} b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b^{3}}{4 d}\) \(113\)
norman \(\frac {\left (\frac {3}{2} a^{2} b +\frac {3}{8} b^{3}\right ) x +\left (6 a^{2} b +\frac {3}{2} b^{3}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (6 a^{2} b +\frac {3}{2} b^{3}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (9 a^{2} b +\frac {9}{4} b^{3}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{2} a^{2} b +\frac {3}{8} b^{3}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (8 a^{3}-12 a^{2} b +24 a \,b^{2}-5 b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 a^{3}+12 a^{2} b +24 a \,b^{2}+5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (24 a^{3}-12 a^{2} b +40 a \,b^{2}+3 b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (24 a^{3}+12 a^{2} b +40 a \,b^{2}-3 b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) \(286\)

[In]

int(cos(d*x+c)*(a+cos(d*x+c)*b)^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^3*sin(d*x+c)+3*a^2*b*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+a*b^2*(2+cos(d*x+c)^2)*sin(d*x+c)+b^3*(1
/4*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+3/8*d*x+3/8*c))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.69 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {3 \, {\left (4 \, a^{2} b + b^{3}\right )} d x + {\left (2 \, b^{3} \cos \left (d x + c\right )^{3} + 8 \, a b^{2} \cos \left (d x + c\right )^{2} + 8 \, a^{3} + 16 \, a b^{2} + 3 \, {\left (4 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c))^3,x, algorithm="fricas")

[Out]

1/8*(3*(4*a^2*b + b^3)*d*x + (2*b^3*cos(d*x + c)^3 + 8*a*b^2*cos(d*x + c)^2 + 8*a^3 + 16*a*b^2 + 3*(4*a^2*b +
b^3)*cos(d*x + c))*sin(d*x + c))/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 233 vs. \(2 (109) = 218\).

Time = 0.18 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.93 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\begin {cases} \frac {a^{3} \sin {\left (c + d x \right )}}{d} + \frac {3 a^{2} b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 a b^{2} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 b^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 b^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\left (c \right )}\right )^{3} \cos {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c))**3,x)

[Out]

Piecewise((a**3*sin(c + d*x)/d + 3*a**2*b*x*sin(c + d*x)**2/2 + 3*a**2*b*x*cos(c + d*x)**2/2 + 3*a**2*b*sin(c
+ d*x)*cos(c + d*x)/(2*d) + 2*a*b**2*sin(c + d*x)**3/d + 3*a*b**2*sin(c + d*x)*cos(c + d*x)**2/d + 3*b**3*x*si
n(c + d*x)**4/8 + 3*b**3*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*b**3*x*cos(c + d*x)**4/8 + 3*b**3*sin(c + d*x
)**3*cos(c + d*x)/(8*d) + 5*b**3*sin(c + d*x)*cos(c + d*x)**3/(8*d), Ne(d, 0)), (x*(a + b*cos(c))**3*cos(c), T
rue))

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.79 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} b - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a b^{2} + {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3} + 32 \, a^{3} \sin \left (d x + c\right )}{32 \, d} \]

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c))^3,x, algorithm="maxima")

[Out]

1/32*(24*(2*d*x + 2*c + sin(2*d*x + 2*c))*a^2*b - 32*(sin(d*x + c)^3 - 3*sin(d*x + c))*a*b^2 + (12*d*x + 12*c
+ sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*b^3 + 32*a^3*sin(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.79 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {b^{3} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {a b^{2} \sin \left (3 \, d x + 3 \, c\right )}{4 \, d} + \frac {3}{8} \, {\left (4 \, a^{2} b + b^{3}\right )} x + \frac {{\left (3 \, a^{2} b + b^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, a^{3} + 9 \, a b^{2}\right )} \sin \left (d x + c\right )}{4 \, d} \]

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c))^3,x, algorithm="giac")

[Out]

1/32*b^3*sin(4*d*x + 4*c)/d + 1/4*a*b^2*sin(3*d*x + 3*c)/d + 3/8*(4*a^2*b + b^3)*x + 1/4*(3*a^2*b + b^3)*sin(2
*d*x + 2*c)/d + 1/4*(4*a^3 + 9*a*b^2)*sin(d*x + c)/d

Mupad [B] (verification not implemented)

Time = 16.29 (sec) , antiderivative size = 279, normalized size of antiderivative = 2.31 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {\left (2\,a^3-3\,a^2\,b+6\,a\,b^2-\frac {5\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (6\,a^3-3\,a^2\,b+10\,a\,b^2+\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (6\,a^3+3\,a^2\,b+10\,a\,b^2-\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^3+3\,a^2\,b+6\,a\,b^2+\frac {5\,b^3}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {3\,b\,\mathrm {atan}\left (\frac {3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2+b^2\right )}{4\,\left (3\,a^2\,b+\frac {3\,b^3}{4}\right )}\right )\,\left (4\,a^2+b^2\right )}{4\,d}-\frac {3\,b\,\left (4\,a^2+b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \]

[In]

int(cos(c + d*x)*(a + b*cos(c + d*x))^3,x)

[Out]

(tan(c/2 + (d*x)/2)^7*(6*a*b^2 - 3*a^2*b + 2*a^3 - (5*b^3)/4) + tan(c/2 + (d*x)/2)^3*(10*a*b^2 + 3*a^2*b + 6*a
^3 - (3*b^3)/4) + tan(c/2 + (d*x)/2)^5*(10*a*b^2 - 3*a^2*b + 6*a^3 + (3*b^3)/4) + tan(c/2 + (d*x)/2)*(6*a*b^2
+ 3*a^2*b + 2*a^3 + (5*b^3)/4))/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d*x)/2)^4 + 4*tan(c/2 + (d*x)/2)^6 +
 tan(c/2 + (d*x)/2)^8 + 1)) + (3*b*atan((3*b*tan(c/2 + (d*x)/2)*(4*a^2 + b^2))/(4*(3*a^2*b + (3*b^3)/4)))*(4*a
^2 + b^2))/(4*d) - (3*b*(4*a^2 + b^2)*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(4*d)